package com.activiti.z_six.service;

import com.activiti.z_six.entity.controllerParams.ProcessTaskParams;
import com.activiti.z_six.entity.taskAssignee.OvTaskEntity;
import com.activiti.z_six.entity.taskAssignee.TaskInstEntity;
import com.activiti.z_six.util.ResultRes;
import org.activiti.bpmn.model.UserTask;

import java.util.HashMap;
import java.util.List;

public interface ProcessTaskService {
    /**
    启动流程
    processDefinitionKey:流程实例key
    instanceName：流程名称
    variables：自定义参数
     */
    public HashMap<String,Object> startProcess(ProcessTaskParams processTaskParams);
    /**
    流程审核
    taskId：任务id
    variables：自定义参数
     */
    public HashMap<String,Object> sendWork(ProcessTaskParams processTaskParams);

    /**
     * 触发等待任务
     * @param processInstanceId
     * @param taskKey
     * @param executionId
     * @return
     */
    public String sendReceiceTask(String processInstanceId, String taskKey, String executionId);
    /*
    退回
     */
    public OvTaskEntity returnWork(String processInstanceId,String taskId,String returnToTaskKey
            ,String returnMsg,HashMap<String,Object> variables);
    /*
    移交
     */
    public OvTaskEntity transfer(String processInstanceId,String taskId,String Msg,
                                 String toUser,HashMap<String,Object> variables);
    /*
    加签
     */
    public OvTaskEntity countersign(String processInstanceId,String taskId,String Msg,
                                    String toUser,HashMap<String,Object> variables);
    /*
    拒绝
     */
    public void refuse(String processInstanceId,String taskId,String Msg,
                               HashMap<String,Object> variables);
    /*
    跳转
     */
    public void jump(String processInstanceId,String taskId,HashMap<String,Object> variables);
    /*
    强制结束
     */
    public void setEndTask(String processInstanceId,String taskId,String Msg,
                       HashMap<String,Object> variables);
    /*
    增加轨迹
     */
    public void addTaskInstTrack(String processInstanceId,OvTaskEntity ovTaskEntity
            ,String status,String msg);
    /*
    获取任务处理轨迹
     */
    public List<TaskInstEntity> getUserTaskTrack(String processInstanceId);
    /*
    获取下一步节点信息
     */
    public List<UserTask> getNextTaskInfo(String procInstId, String taskid, HashMap<String,Object> variables);
    /*
    获取下一步任务处理人
     */
    public HashMap<String,Object> getNextUserInfo(String procInstId,String taskid,HashMap<String,Object> variables);
    /**
     * 获取待办任务
     * @param pageNum
     * @param pagesize
     * @param flowName
     * @return
     */
    public HashMap<String,Object> getTodoList(Integer pageNum,Integer pagesize,String flowName);
    /**
    获取待办任务列表
    flowSort:流程类别
    proceId:流程实例ID，类似流程编号
     */
    public HashMap<String,Object> getTodoTask(String flowSort, String proceId, Integer page, Integer pagesize);
    /*
    获取已审核任务列表
    flowSort:流程类别
    proceId:流程实例ID，类似流程编号
     */
    public HashMap<String, Object> getHistoricTaskInstance(String flowName, Integer pageNum
            , Integer pagesize);
    /*
    获取绑定的表单
     */
    public HashMap<String, Object> getHisFormJson(String processKey,String taskid);
    /*
    保存
     */
    public String saveForm(String proce_inst_id,String id);
}
